var obj = {
    eat : function(_type){
        if(_type == '猫'){
            console.log('猫粮')
        }else if (_type == "狗") {
            console.log('狗粮')
        }else{
            console.log("吃饭");
        }
    }
};
obj.eat("狗");